//
//  UIImageView+ForScrollView.m
//  ZFChartView
//
//  Created by rimi on 16/3/23.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "UIImageView+ForScrollView.h"
#import <objc/runtime.h>
#define noDisableVerticalScrollTag 836913
#define noDisableHorizontalScrollTag 836914

@implementation UIImageView (ForScrollView)

- (void)setAlpha:(CGFloat)alpha
{
    if (self.superview.tag == noDisableVerticalScrollTag) {
        if (alpha == 0 && self.autoresizingMask == UIViewAutoresizingFlexibleLeftMargin) {
            if (self.frame.size.width < 10 && self.frame.size.height > self.frame.size.width) {
                UIScrollView *sc = (UIScrollView*)self.superview;
                if (sc.frame.size.height < sc.contentSize.height) {
                    [super setAlpha:1];
                    return;
                }
            }
        }
    }else  if (self.superview.tag == noDisableHorizontalScrollTag ) {
        if (self.frame.size.height < 10 && self.frame.size.height < self.frame.size.width) {
            self.image = [UIImage imageNamed:@"scrollTintor.png"];
            [super setAlpha:1];
            self.tag = 4555;
            return;
        }
        if (self.tag == 4555) {
            self.image = [UIImage imageNamed:@"scrollTintor.png"];
            [super setAlpha:1];
             return;
        }
        
    }
    [super setAlpha:alpha];
    
    
}//时段收入的滚动条背景








@end
